﻿using GN.Pay.Application.Dto.Input;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GN.Pay.UnitTest.AppService
{
    /// <summary>
    /// 应用单元测试帮助
    /// </summary>
    public abstract class AppUnitTestUtils
    {
        /// <summary>
        /// 应用Id
        /// </summary>
        public static string AppId { get; set; } = "gn56321522691554141803";

        /// <summary>
        /// 商户
        /// </summary>
        public static string MerchantId { get; set; } = "608856324915310313201712";

        /// <summary>
        /// 应用Ip
        /// </summary>
        public static string AppIp { get; set; } = "127.0.0.1";

        /// <summary>
        /// 设置应用
        /// </summary>
        /// <typeparam name="T">类型</typeparam>
        /// <param name="source">源</param>
        /// <returns></returns>
        public static T SetApp<T>(T source) where T : ServiceBaseInput
        {
            source.AppId = AppUnitTestUtils.AppId;
            source.MerchantId = AppUnitTestUtils.MerchantId;
            return source;
        }
    }
}
